
package rudy.elevator.thread;

import rudy.elevator.ui.MainPanel;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import rudy.elevator.bean.LiftBean;

public class OpenDoor extends Thread{
    private MainPanel panel;
    public OpenDoor(MainPanel  panel) {
        this.panel = panel;
    }

    public void run()
    {
        LiftBean   [] lifts = panel.getLiftbean();

        for(int j = 0;j<lifts.length;j++)
        {
           /* LiftBean lift = lifts[j];
            for (int i = 0; i < lift.getDx() / 2; i++) {
                lift.setXx(lift.getDx() / 2 - i - 1);
                try {
                    Thread.sleep(5);
                } catch (InterruptedException ex) {
                }
                panel.repaint();
            }*/
           OpenThread   thread_= new OpenThread(lifts[j],panel);
           thread_.start();
        }
    }
}


